package com.mtons.mblog.im.common;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

@Slf4j
@Data
public class Result implements Serializable {

    private int code = 0;
    private String msg = "操作成功";
    private Object data;

    public static Result ok(Object data) {
        Result r = new Result();
        r.data = data;
        return r;
    }

    public static Result fail(String msg) {
        Result r = new Result();
        r.data = null;
        r.code = -1;
        r.msg = msg;
        return r;
    }
}
